java找不到参数的方法实现()
我试着运行我的应用程序,但gradle不想编写它
你能告诉我该怎么办吗
Error:(36, 0) Could not find method implementation() for arguments [com.google.firebase:firebase-appindexing:11.6.2] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
我的应用程序构建。梯度锉
minSdkVersion 14
targetSdkVersion 22
signingConfig signingConfigs.config
}
buildTypes {
release {
debuggable false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-安卓.txt'), 'proguard-rules.txt'
signingConfig signingConfigs.config
}
}
lintOptions {
disable 'MissingTranslation'
}
productFlavors {
}
}
dependencies {
implementation 'com.google.firebase:firebase-appindexing:11.6.2'
compile project(':AndEngine')
compile files('libs/gson-2.8.0.jar')
compile 'com.安卓.support:support-v4:22.2.1'
compile 'com.google.firebase:firebase-core:10.2.4'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.google.安卓.gms:play-services-ads:10.2.4'
compile 'com.google.firebase:firebase-ads:10.2.4'
compile 'com.google.firebase:firebase-crash:10.2.4'
}
# 1 楼答案
替换
与
您需要更新gradle版本才能使用
implementation
。 可以在项目构建中更新构建脚本块。格拉德尔
<> P>因此,让您的项目编译只更改我建议的那一行,但是考虑更新您的分级版本,并使用^ {CD1>}为您的所有依赖项。compile
已被弃用,未来的gradle版本将不再支持它更新
firebase依赖项的所有模块都应该使用相同的版本
所以你可能需要更新你的应用程序版本。往这边走
或者您可能有新的生成错误
还有
不是最新版本,可能会带来新问题
但我建议循序渐进:)
更新2
如果用这种方式声明gson的依赖项
你不需要
它是多余的,而且你可以释放你的libs文件夹中无用的jar文件